import request from '@/utils/request'

// 获取树状机构信息
export const getTreeList = () => {
  return request.get('/manager/business-hall/tree')
}

// 获取机构详情
export const getInstitutionDetails = (id) => {
  return request.get(`/manager/business-hall/${id}`)
}

// 获取员工信息列表
export const getStaffList = (params) => {
  return request.get('/manager/business-hall/user/page', { params })
}

// 获取业务范围
export const lineOfBusiness = (id, type) => {
  return request.get(`/manager/business-hall/scope/${id}/${type}`)
}

// 根据父id获取地址信息
export const getAreasList = (parentId) => {
  return request({ url: '/manager/areas/children', params: { parentId }})
}

// 编辑机构
export const editBusinessHall = (data) => {
  return request.post('/manager/business-hall', data)
}

// 保存业务范围
export const asveBusinessSope = (data) => {
  return request.post('/manager/business-hall/scope', data)
}
